
	<div class="row clearfix">
	 <form class="navbar-form navbar-left" action="#" role="search">
      <div class="form-group">
        <div class="input-group input-group-rounded">
          <input class="form-control" id="keyword" type="search" placeholder="请输入教程名">
          <span class="input-group-btn">
            <button type="submit" class="btn kesn_search"><span class="fui-search"></span></button>
          </span>
        </div>
      </div>
    </form>

		<div class="col-md-12 column">
			<div class="row clearfix">
				<div class="col-md-3 column">
					<div class="panel-group" id="panel-863304">
						{volist name="coursemodule" id="coursemodule"}
						<div class="panel panel-default">
							<div class="panel-heading">
								 <a class="panel-title collapsed" data-toggle="collapse" data-parent="#panel-863304" href="#{$coursemodule.id}">{$coursemodule.course_module}</a>
							</div>
							<div id="{$coursemodule.id}" class="panel-collapse collapse">
								<div class="panel-body">
									<ul class="list-group">
									{volist name="coursemodule.course" id="course"}
							        	<li class="list-group-item kesn_course" data-course_id="{$course.id}"><a href="#">{$course.course}</a></li>
							        {/volist}	
							        </ul>
								</div>
							</div>
						</div>
						{/volist}
						
					</div>
				</div>
				<div class="col-md-8 column well kesn_well" style="min-height: 1000px;">

				</div>&nbsp;
				<a href="#" class="btn btn-primary" id="print_course">打印<span class="icon-print btn-tip"></span></a>
			</div>
		</div>
	</div>
	
{include file="../application/app/view/footer.html" /}
<script type="text/javascript" src="/static/js/jQuery.print.js"></script>
<script type="text/javascript">
$('#panel-863304').on('click','.kesn_course',function(){
		var _this = $(this);
		var course_id = _this.attr('data-course_id');
		 $.ajax({
	      url : 'get_course_content',
	      async:true,
	      type:'POST',
	      data:{'course_id':course_id},
	      dataType:'JSON',
	      success:function(data,textStatus,jqXHR){
	      	var _html = '';
	            if (data.err != 0) {
	            	_html = '<div>'+data.content+'<div>';
	         
	            }else if (data.err == 0) {
	            	_html = '<div>'+data.content+'</div>';
	                      
                }
                $('.kesn_well').html(_html);
	          },
	          error:function(){
	           
	          }
	    });
	});
//搜索
$('.kesn_search').click(function(){
	var _this = $(this);
	var keyword = $('input#keyword').val();
	if (keyword == '') {
		return;
	}
	 $.ajax({
	      url : 'search_course',
	      async:true,
	      type:'POST',
	      data:{'keyword':keyword},
	      dataType:'JSON',
	      success:function(data,textStatus,jqXHR){
	      		var _html = '';
	            if (data.err != 0) {
	            	alert(data.content);
	         
	            }else if (data.err == 0) {
	            	_html = '<div class="panel panel-default keyword_answer"><div class="panel-heading"><a class="panel-title collapsed" data-toggle="collapse" data-parent="#panel-863304" href="#courseModule">搜索答案</a></div><div id="courseModule" class="panel-collapse collapse"><div class="panel-body"><ul class="list-group">';
	            	var course = data.data;
	            	for(var key in course){
	            		var html_tmp = '<li class="list-group-item kesn_course" data-course_id="'+course[key].id+'"><a href="#">'+course[key].course+'</a></li>';
	            		_html = _html + html_tmp;
	            	}
	               	_html+=' </ul></div></div></div>';
	               	$('.keyword_answer').remove();
	               	$('#panel-863304').prepend(_html);  
                }
                
	          },
	          error:function(){
	           
	          }
	    });

});
</script>
<script>
	$('#print_course').click(function(){
		$('.kesn_well').print();
	});
</script>
</footer>
</body>
</html>